package cn.com.xuhx;

import cn.com.xuhx.impl.HelloServiceImpl;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

public class App {

    public static void main(String[] args) {
        //创建jetty服务对象
        JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();
        jaxWsServerFactoryBean.setAddress("http://localhost:8899/hello_server");
        //设置服务实现类（注意：一个jetty服务对象只能绑一个服务）
        jaxWsServerFactoryBean.setServiceClass(HelloServiceImpl.class);
        //创建服务
        Server server = jaxWsServerFactoryBean.create();
        //启动服务
        server.start();
    }
}
